<template>
	<view class="container">
		<view class="order">
			<scroll-view class="scroll" scroll-y="true" scroll-x="true" >
				<view class="head">
					<view class="head-item">交易时间</view>
					<view class="head-item">商品</view>
					<view class="head-item">订单数</view>
					<view class="head-item">收货客户</view>
					<!-- <view class="head-item">状态</view> -->
					<view class="head-item">交易金额</view>
				</view>
				<view class="list" v-for="(item,index) in this.customer_order">
					<view class="list-item">{{item.jysj}}</view>
					<view class="list-item special">
						<view class=" goods" v-for="(item_item,index) in item.goods">
							<view class="goods-item">{{item_item.spmc}}</view>
							<view class="goods-item">x{{item_item.spsl}}</view>
						</view>
					</view>
					<view class="list-item">
						{{item.psdz}}
						<!-- <button type="primary" size="mini" @click="navigate(item.psdz,item)">导航</button> -->
					</view>
					<!-- <view class="list-item">交易成功</view> -->
					<view class="list-item">{{item.sum_money}}</view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				
			}
		},
		computed: {
		  ...mapState('order', {
			  customer_order: state => state.customer_order
		  }),
		},
		beforeMount() {
			// console.log('customer_order', this.customer_order)
			// console.log('beforeMount')
		},
		onLoad() {
			// console.log('onLoad')
			// 获取顾客订单
			this.$store.dispatch('order/getCusOrder')
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
	.container{
		position: relative;
	}
	.order{
		width: 98%;
		position: absolute;
		// border: 1upx solid #ff0000;
		left: 1%;
		top: 20upx;
		.scroll{
			// white-space: nowrap;
			// border: 1upx solid #ff0000;
		}
	}
	.head{
		display: flex;
		flex-direction: row;
		// width: 180%;
		 line-height: 100upx;
		.head-item{
			flex-grow: 1;
			text-align: center;
			background-color: #F5f5f5;
			color: gray;
			// border: 1rpx solid #00f;
			// width: 16.6%;
			// line-height: 60upx;
		}
	}
	.goods{
		// border: 1rpx solid #f00;
		display: flex;
		flex-direction: row;
		align-items: center;
		.goods-item{
			flex-grow: 1;
			width: 20%;
			// border: 1rpx solid #f00;
		}
		// justify-content: space-between;
		// margin-bottom: 20rpx;
		// padding: 20rpx 0;
	}
	.list{
		// width: 180%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		// border: 1upx solid #f00;
		border-bottom: 1rpx solid #bbb;
		padding: 20rpx 0;
		.list-item{
			/* display: inline-block;
			vertical-align: middle; */
			// flex-grow: 1;
			width: 20%;
			text-align: center;
			// border: 1rpx solid #00f;
		}
		.special{
			width: 40%;
		}
	}
</style>
